<?php
class Delivery_Model_Factory
{
	private static $prefixDbTable	= 'Delivery_Model_DbTable_';
	private static $prefixMapper	= 'Delivery_Model_Mapper_';
	private static $prefixCollection= 'Delivery_Model_Collection_';
	
	private function __construct()
	{
	}	
	
	public function __clone()
	{
	}
	
	public static function dbTable ( $table )
	{
	
		$className = self::$prefixDbTable . $table;	
		
		if ( !Zend_Registry::isRegistered($className) ){
		
			Zend_Registry::set( $className, new $className);
			
		}
		
		return Zend_Registry::get($className);
	}
	
	public static function mapper ( $mapper )
	{
	
		$className = self::$prefixMapper . $mapper;	
		
		if ( !Zend_Registry::isRegistered($className) ){
		
			Zend_Registry::set( $className, new $className);
			
		}
		
		return Zend_Registry::get($className);
	}
	
	public static function collection ( $collection )
	{
		
		$className = self::$prefixCollection . $collection;	
		
		return new $className;
	}
	
	
}